#
whycq
2023-10-11 c8107a39f7611e256c473d72df58e45bc02ad7eb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
function isEmpty(obj) {
    if (JSON.stringify(obj) === '{}') {
        return true
    }
    return  obj == "undefined" || obj == null || obj === "" || obj == {};
}
 
const baseUrl = 'http://127.0.0.1:9528'
 
async function getCompanyData() {
    let _this = this,item = [];
    var ress = await uni.request({
        url: `${baseUrl}/dashboard/companyData/auth`,
        header:{'token':uni.getStorageSync('token')},
    }).then((res)=> {
        res = res[1].data
        if (res.code === 200) {
            item = [
                {name: '年度销售目标',content: res.data.yearTarget,unit: '万元'},
                {name: '已完成销售任务',content: res.data.successMoney,unit: '万元'},
                {name: '未完成销售任务',content: res.data.progressMoney,unit: '万元'},
                {name: '完成率',content: res.data.yearTransactionRate,unit: '%'}
            ]
        }
    },(result)=>{
        // console.log(res);
    })
    return item
}
 
module.exports = {
    getCompanyData: getCompanyData
}