ypzycp/pages/examinee/expert/detail/detail.js

52 lines
1.2 KiB
JavaScript
Raw Normal View History

2022-01-17 18:27:44 +08:00
Page({
2022-01-20 18:07:08 +08:00
data: {
title: '',
id:1,
expertDetail: []
},
onLoad(options) {
this.data.id=options.id;
this.getExpertDetail();
2022-01-17 18:27:44 +08:00
dd.setNavigationBar({
2022-01-20 18:07:08 +08:00
title: options.name+'-'+options.tags_text,
2022-01-17 18:27:44 +08:00
backgroundColor: '#FFFFFF',
});
},
2022-01-20 18:07:08 +08:00
getExpertDetail(){
let params = {
id: this.data.id
};
let token = '';
dd.getStorage({
key: 'token',
success: (res)=> {
// dd.alert({content: '获取成功:' + res.data.authCode});
token = res.data.token;
dd.utils.$http('/api/consumer/expert-info','GET',params,token).then(
(data) => {
let list = data.data.data;
let newarray = []
let array = {
name: list.name,
slogan: list.slogan,
summary: list.summary,
service_area_text: list.service_area_text,
mainCaseList: list.mainCaseList
}
newarray = array;
this.setData({
expertDetail:newarray
})
console.log(array);
},
(err) => {
console.log('错误:'+err);
}
);
},
fail: (res)=>{
dd.alert({content: res.errorMessage});
}
});
}
2022-01-17 18:27:44 +08:00
});