feat: 搭建微信小程序展示端
- 初始化小程序工程配置与类型声明 - 增加首页、律所、律师列表、详情与历史页面 - 补充公共组件、运行时配置与示例素材
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
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 : '',
|
||||
});
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user