40 lines
797 B
TypeScript
40 lines
797 B
TypeScript
Component({
|
||
properties: {
|
||
/** 是否显示 */
|
||
visible: {
|
||
type: Boolean,
|
||
value: true,
|
||
},
|
||
/** 跳转目标页面 */
|
||
targetUrl: {
|
||
type: String,
|
||
value: '/pages/chat/chat',
|
||
},
|
||
/** 可选:携带客户 ID 参数 */
|
||
customerId: {
|
||
type: String,
|
||
value: '',
|
||
},
|
||
/** 距底部距离(rpx),TabBar 页面用 200,非 TabBar 页面用 120 */
|
||
bottom: {
|
||
type: Number,
|
||
value: 200,
|
||
},
|
||
},
|
||
|
||
methods: {
|
||
onTap() {
|
||
let url = this.data.targetUrl
|
||
if (this.data.customerId) {
|
||
url += `?customerId=${this.data.customerId}`
|
||
}
|
||
wx.navigateTo({
|
||
url,
|
||
fail: () => {
|
||
wx.showToast({ title: '页面跳转失败', icon: 'none' })
|
||
},
|
||
})
|
||
},
|
||
},
|
||
})
|