Files
HTFX-CRM-Sales/services/common.ts
2025-07-07 16:05:18 +08:00

102 lines
2.5 KiB
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { UserLanguage } from '@/utils/const';
import { request } from '@/utils/request.ts';
export function getTemplateDetailByCode(templateCode: string) {
return request({
url: '/api/sys/template/getTemplateDetailByCode',
method: 'GET',
data: {
qcc_language: UserLanguage,
templateCode
}
});
}
export function getCountryList() {
return request({
url: '/api/common/getCountry',
method: 'GET'
});
}
export function getStateList(pid: string) {
return request({
url: `/api/common/getStates?pid=${pid}`,
method: 'GET'
});
}
export function getCityList(pid: string) {
return request({
url: `/api/common/getCity?pid=${pid}`,
method: 'GET'
});
}
/**
* 查询mt账户列表
* GET /app/common/mt/login
* 接口ID194898720
* 接口地址https://app.apifox.com/link/project/4728063/apis/api-194898720
* @return
*/
export function getMtLoginList() {
return request({
url: '/api/app/common/mt/login',
method: 'GET'
});
}
export function imgUpload(res: any) {
// const formData = new FormData();
// formData.append('file', file);
return new Promise((resolve, reject) => {
uni.uploadFile({
url: '/api/ossUpload/imgUpload',
name: 'file',
filePath: res.tempFilePaths[0],
success: function (res) {
resolve(JSON.parse(res.data));
},
fail: function (err) {
reject(err);
}
});
});
// return request({
// url: '/api/ossUpload/imgUpload',
// method: 'POST',
// header: {
// 'content-type': 'multipart/form-data'
// },
// data: formData
// });
}
export function getDictByCode(dict_code: string) {
return request({ url: `/api/saleH5/common/getDictByCode?dict_code=${dict_code}&qcc_language=${UserLanguage}`, method: 'GET' });
}
export function getImgPath() {
return request({ url: '/api/app/common/getImgPath', method: 'GET' });
}
export function getFilePath() {
return request({ url: '/api/app/common/getFilePath', method: 'GET' });
}
/**
* 查询出金转账配置querySys
* GET /app/common/querySys
* 接口ID205933296
* 接口地址https://app.apifox.com/link/project/4728063/apis/api-205933296
* @return
*/
export function getSys() {
return request({ url: '/api/app/common/querySys', method: 'GET' });
}
export function getMtServers(data: { qcc_language: string; server_type: string }) {
return request({ url: '/api/app/common/mt/server', method: 'GET', data });
}
export function getCustomerMtLoginList(data: Record<string, any>) {
return request({ url: '/api/app/capital/getMtLoginList', method: 'GET', data });
}