Files
EasyCard/frontend_miniprogram/miniprogram/components/lawyer-card/lawyer-card.ts
陈子默 9605384edc feat: 搭建微信小程序展示端
- 初始化小程序工程配置与类型声明

- 增加首页、律所、律师列表、详情与历史页面

- 补充公共组件、运行时配置与示例素材
2026-03-20 12:44:31 +08:00

34 lines
749 B
TypeScript

Component({
data: {
specialtiesText: '',
},
properties: {
lawyer: {
type: Object,
value: null,
},
showOffice: {
type: Boolean,
value: true,
},
},
observers: {
lawyer(lawyer: { specialties?: string[] } | null) {
const specialties =
lawyer && Array.isArray(lawyer.specialties) ? lawyer.specialties : [];
this.setData({
specialties, // Expose array for wx:for
specialtiesText: specialties.join(' | '),
});
},
},
methods: {
handleTap() {
const lawyer = this.properties.lawyer as { id?: string } | null;
this.triggerEvent('select', {
id: lawyer && typeof lawyer.id === 'string' ? lawyer.id : '',
});
},
},
});