<template>
<view class="absorptive-type">
<view>所属企业:</view>
<view>
<block v-for="(item, index) in companyList" :key="index">
<text v-if="item.dictValue === info.transporterId">{
{
item.dictLabel}}</text>
</block>
</view>
</view>
</template>
data() {
return {
//companyList: [],// 企业列表(接口返回)
// 企业列表(模拟数据)
companyList: [
{
"dictValue: ": "0",
"dictLabel: ": "清表"
},{
"dictValue: ": "1",
"dictLabel: ": "拆迁"
},{
"dictValue: ": "2",
"dictLabel: ": "轨道"
},
],
info:{
transporterId:""//返回的数据
}
}
},
onLoad: function(options) {
this.getCompanyList()
},
//获取企业列表
getCompanyList: function() {
uni.showLoading();
var params = {
url: "/transporterList",
method: "GET",
data: {
},
callBack: res => {
uni.hideLoading()
this.companyList = res.rows
}
};
http.request(params);
}