import { request } from '../utils/request' import { baseUrl } from '../utils/config' export const uploadUrl = baseUrl + '/public/upload' // 小程序 默认登录 export const wxLoginCustomer = (data) => { return request({ url: '/web/personnel/loginByWx', data }) } // 验证码登录 export const loginByPhone = (data) => { console.log(data) return request({ url: '/web/personnel/loginByPhone', data }) } // 发送验证码 export const sendSms = (data) => { return request({ url: '/web/personnel/sendSms', data }) } export const getUserCard = (data) => { return request({ url: '/web/personnel/getUserCard', method: "POST", data }) } // 获取手机号 export const getWxMiniPhone = (data) => { return request({ url: '/web/personnel/getWxMiniPhoneLogin', method: "POST", data }) } // 绑定Openid export const bindingOpenid = (data) => { return request({ url: '/web/personnel/bindingOpenid', data }) } // 获取字典值 export const getDictData = (data) => { return request({ url: '/public/getDictData?code='+data.code+'&label='+data.label, data, loading: '0' }) } // 获取会员信息 export const getMemberInfo = (data) => { return request({ url: '/web/personnel/getUserDetail', data:data }) } // 更新会员信息 export const editMember = (data) => { return request({ url: '/web/personnel/editUsers', method: 'POST', data }) } // 首页 每日上新 export const getDailyUpdates = (data) => { return request({ url: '/web/customer/getDailyUpdates', data }) } //推广咨询分享 export const saveShareRecord = (data) => { return request({ url: '/web/customer/saveShareRecord?id='+data, data, loading: '0' }) } // 产品视频 export const getZhongTaiVideoPage = (data) => { return request({ url: '/web/customer/getZhongTaiVideoPage', method: 'POST', data }) } // 首页 定制服务 列表 export const getCustomizedNewsList = (data) => { return request({ url: '/web/customer/getCustomizedNewsList', data }) } // 定制服务 详情 export const getCustomizedNewsDetail = (data) => { return request({ url: '/web/customer/getCustomizedNewsDetail', data }) } // 首页 推广咨询分页 export const newsPage = (data) => { return request({ url: '/web/customer/newsPage', data, method: "POST" }) } // 首页 志说装修 export const getZSZXCatalogs = () => { return request({ url: '/web/customer/getZSZXCatalogs', method: "POST" }) } // 志说装修 标签 export const getCataLogTagList = (data) => { return request({ url: '/web/customer/getCataLogTagList', method: "POST", data }) } // 中泰 分类数据 export const getCatalogList = (data) => { return request({ url: '/web/customer/getCatalogList', method: "POST", data }) } // 操作 行为内容 export const actionDo = (data) => { return request({ url: '/web/customer/actionDo', data, loading: data.actionType == 'view' ? '0' : '1' }) } // 获取客户-潜客列表 export const getCustomerList = (data) => { return request({ url: '/web/personnel/getCustomerList', method: "POST", data }) } // 批量添加喜欢给客户 export const batchAddLike = (data) => { return request({ url: '/web/personnel/batchAddLike', method: "POST", data }) } export const logout = (data) => { return request({ url: '/web/personnel/logOff', method: "POST", data }) } // 志说装修 内容 export const pageZSZXContentList = (data) => { return request({ url: '/web/customer/getZhongTaiZbDecoPage', method: "POST", data }) } // 获取门店列表 export const getShopPage = (data) => { return request({ url: '/web/customer/shopPage', method: 'POST', data }) } export const updateShop = (data) => { return request({ url: '/web/personnel/updShop', method: 'POST', data }) } // 获取门店详情 export const getShopDetail = (data) => { return request({ url: '/web/personnel/shopDetail?shopId='+data, data }) } // 获取门店详情 export const loadShopList= (data) => { return request({ url: '/web/personnel/userShopList', data }) } // 我的 收藏/喜欢列表 export const collectLikePage = (data) => { return request({ url: '/web/customer/collectLikePage', method: 'POST', data }) } // 分类产品 分页列表 中台 export const getZhongTaiProductPage = (data) => { return request({ url: '/web/customer/getZhongTaiProductPage', method: 'POST', data }) } // 中台 分类产品详情 export const getProductInfo = (data) => { return request({ url: '/web/customer/getProductInfo', data }) } // 分类案例 分页列表 中台 export const getZhongTaiWholecasePage = (data) => { return request({ url: '/web/customer/getZhongTaiWholecasePage', method: 'POST', data }) } // 分类案例 详情 export const getWholecaseInfo = (data) => { return request({ url: '/web/customer/getWholecaseInfo', data }) } // 分类实景 分页列表 中台 export const getZhongTaiRealcasePage = (data) => { return request({ url: '/web/customer/getZhongTaiRealcasePage', method: 'POST', data }) } // 分类实景 详情 export const getRealcaseInfo = (data) => { return request({ url: '/web/customer/getRealcaseInfo', data }) } // 产品资讯 分页列表 中台 export const getZhongTaiProductNewsPage = (data) => { return request({ url: '/web/customer/getZhongTaiProductNewsPage', method: 'POST', data }) } // 产品资讯 详情 export const getProductNewsInfo = (data) => { return request({ url: '/web/customer/getProductNewsInfo', method: 'GET', data }) } // 内容 收藏 export const collectContent = (data) => { return request({ url: '/web/customer/collectContent', method: 'GET', data }) } // 获取内容分享海报 export const getContentShareImg = (data) => { return request({ url: '/web/personnel/getContentShareImg', method: 'POST', data }) } // 0元定制信息 export const saveFreeCustomizationApply = (data) => { return request({ url: '/web/customer/saveFreeCustomizationApply', method: 'POST', data }) } // 获取计算器配置 export const getBjParamConfig = (data) => { return request({ url: '/web/customer/getBjParamConfig', data }) } // 保存计算器配置 export const saveRenovationCalculator = (data) => { return request({ url: '/web/customer/saveRenovationCalculator', method: 'POST', data }) } // 获取省市区 export const getArea = (data) => { return request({ url: '/web/common/getArea', data }) } // 小程序注销 export const wxLogOff = (data) => { return request({ url: '/web/customer/logOff', data }) } export const getCrmAuthUrl = (data) => { return request({ url: '/web/customer/getCrmAuthUrl', data }) } export const refreshEnjoy = (obj) =>{ let child = obj.selectComponent('.buoyClient'); // 调用子组件中定义的方法 if(child){ child.freshData(); } var {info} = obj.data ; if(info){ const enjoyList = wx.getStorageSync('enjoyList') || []; const index = enjoyList.findIndex( i => i.id === info.id ); info.isEnjoy = index > -1; obj.setData({ info:info}) ; } }