114 lines
2.4 KiB
JavaScript
114 lines
2.4 KiB
JavaScript
|
|
import {
|
||
|
|
sendRequest,
|
||
|
|
sendRequestJson
|
||
|
|
} from "../../common/http/api.js"
|
||
|
|
/**
|
||
|
|
* 显示消息提示框
|
||
|
|
* @param content 提示的标题
|
||
|
|
*/
|
||
|
|
function toast(content, callBack) {
|
||
|
|
uni.showToast({
|
||
|
|
icon: 'none',
|
||
|
|
title: content,
|
||
|
|
duration: 2000,
|
||
|
|
success: () => {
|
||
|
|
console.log('22')
|
||
|
|
if (callBack) {
|
||
|
|
setTimeout(() => {
|
||
|
|
callBack()
|
||
|
|
}, 2000)
|
||
|
|
}
|
||
|
|
}
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
//POST请求
|
||
|
|
function POST(url, params) {
|
||
|
|
return new Promise((resolve, reject) => {
|
||
|
|
sendRequestJson("POST", url, params).then(res => {
|
||
|
|
let {
|
||
|
|
code,
|
||
|
|
msg,
|
||
|
|
data
|
||
|
|
} = res;
|
||
|
|
if (code == 200) {
|
||
|
|
resolve(data)
|
||
|
|
} else {
|
||
|
|
console.log(res)
|
||
|
|
toast(msg)
|
||
|
|
reject(data)
|
||
|
|
}
|
||
|
|
})
|
||
|
|
}).catch(error => {
|
||
|
|
uni.hideLoading();
|
||
|
|
let {
|
||
|
|
message
|
||
|
|
} = error
|
||
|
|
toast(message)
|
||
|
|
reject(message)
|
||
|
|
})
|
||
|
|
}
|
||
|
|
// 查询槟榔树资产
|
||
|
|
export function getMyAsset() {
|
||
|
|
return POST('new2411/myAsset')
|
||
|
|
}
|
||
|
|
|
||
|
|
// 查询资产详情
|
||
|
|
export function myAssetDetail() {
|
||
|
|
return POST('new2411/myAssetDetail')
|
||
|
|
}
|
||
|
|
// 查询购买记录
|
||
|
|
export function getRecordList() {
|
||
|
|
return POST('new2411/getRecordList')
|
||
|
|
}
|
||
|
|
|
||
|
|
// 兑付资产转余额
|
||
|
|
export function caseTree2Balance(data) {
|
||
|
|
return POST('new2411/caseTree2Balance', data)
|
||
|
|
}
|
||
|
|
// 补贴转余额
|
||
|
|
export function caseWared2Balance(data) {
|
||
|
|
return POST('new2411/caseWared2Balance', data)
|
||
|
|
}
|
||
|
|
// 消费金转余额
|
||
|
|
export function fund2Balance(data) {
|
||
|
|
return POST('new2411/fund2Balance', data)
|
||
|
|
}
|
||
|
|
|
||
|
|
// 余额转账 //beneficiaryUserId changeMoney
|
||
|
|
export function handleTransferAccounts(data) {
|
||
|
|
return POST('new2411/handleTransferAccounts', data)
|
||
|
|
}
|
||
|
|
|
||
|
|
// 消费券转账 //beneficiaryUserId changeMoney
|
||
|
|
export function handleTransferConsume(data) {
|
||
|
|
return POST('new2411/handleTransferConsume', data)
|
||
|
|
}
|
||
|
|
|
||
|
|
// 提现申请
|
||
|
|
export function balanceCaseApply(data) {
|
||
|
|
return POST('new2411/balanceCaseApply', data)
|
||
|
|
}
|
||
|
|
// 充值记录
|
||
|
|
export function rechargeLog(data) {
|
||
|
|
return POST('new2411/rechargeLog', data)
|
||
|
|
}
|
||
|
|
export function countIntegerPriceApi() {
|
||
|
|
return POST('new2411/countIntegerPrice')
|
||
|
|
}
|
||
|
|
// 统计数据
|
||
|
|
export function integerInfo() {
|
||
|
|
return POST('new2411/integerInfo')
|
||
|
|
}
|
||
|
|
// 统计数据
|
||
|
|
export function oldAssetCaseBalance(assetType) {
|
||
|
|
return POST('new2411/oldAssetCaseBalance/' + assetType)
|
||
|
|
}
|
||
|
|
// 实名认证查询
|
||
|
|
export function authenticationApi() {
|
||
|
|
return POST('new2411/Authentication')
|
||
|
|
}
|
||
|
|
export function signContract2411Api(id, contractType) {
|
||
|
|
return POST('contract/sign/createContract2411/' + id + '/' + contractType)
|
||
|
|
}
|