Files
Neo-ZQYY/apps/miniprogram - 副本/miniprogram/components/ai-float-button/ai-float-button.ts

40 lines
797 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
Component({
properties: {
/** 是否显示 */
visible: {
type: Boolean,
value: true,
},
/** 跳转目标页面 */
targetUrl: {
type: String,
value: '/pages/chat/chat',
},
/** 可选:携带客户 ID 参数 */
customerId: {
type: String,
value: '',
},
/** 距底部距离rpxTabBar 页面用 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' })
},
})
},
},
})