问题描述:

(1)会话消息的标题在安卓上正常显示(2)在ios上 有点儿问题

    

(未给卡片设置标题,ios上还是会显示,但是安卓上面正常)

解决办法:

把后端返回来的值做个判断。

send-message-title="{{send_message_tit==''?' ':send_message_tit}}"

判断返回的值  是否为空,空的话,就让标题为空格(为了兼容ios),否则标题使用后端返回的。

<button open-type="contact" class='look' show-message-card send-message-img='{{send_message_image}}' send-message-title="{{send_message_tit==''?' ':send_message_tit}}" session-from="{{session_from}}" send-message-path="/pages/wxbook/wxbook2{{path_str}}" bindcontact="bindContact">去公众号</button>

官方文档地址:button

属性类型默认值必填说明最低版本
sizestringdefault按钮的大小1.0.0
typestringdefault按钮的样式类型1.0.0
plainbooleanfalse按钮是否镂空,背景色透明1.0.0
disabledbooleanfalse是否禁用1.0.0
loadingbooleanfalse名称前是否带 loading 图标1.0.0
form-typestring 用于 form 组件,点击分别会触发 form 组件的 submit/reset 事件1.0.0
open-typestring 微信开放能力1.1.0
hover-classstringbutton-hover指定按钮按下去的样式类。当 hover-class="none" 时,没有点击态效果1.0.0
hover-stop-propagationbooleanfalse指定是否阻止本节点的祖先节点出现点击态1.5.0
hover-start-timenumber20按住后多久出现点击态,单位毫秒1.0.0
hover-stay-timenumber70手指松开后点击态保留时间,单位毫秒1.0.0
langstringen指定返回用户信息的语言,zh_CN 简体中文,zh_TW 繁体中文,en 英文。1.3.0
session-fromstring 会话来源,open-type="contact"时有效1.4.0
send-message-titlestring当前标题会话内消息卡片标题,open-type="contact"时有效1.5.0
send-message-pathstring当前分享路径会话内消息卡片点击跳转小程序路径,open-type="contact"时有效1.5.0
send-message-imgstring截图会话内消息卡片图片,open-type="contact"时有效1.5.0
app-parameterstring 打开 APP 时,向 APP 传递的参数,open-type=launchApp时有效1.9.5
show-message-cardbooleanfalse是否显示会话内消息卡片,设置此参数为 true,用户进入客服会话会在右下角显示"可能要发送的小程序"提示,用户点击后可以快速发送小程序消息,open-type="contact"时有效1.5.0
bindgetuserinfoeventhandle 用户点击该按钮时,会返回获取到的用户信息,回调的detail数据与wx.getUserInfo返回的一致,open-type="getUserInfo"时有效1.3.0
bindcontacteventhandle 客服消息回调,open-type="contact"时有效1.5.0
bindgetphonenumbereventhandle 获取用户手机号回调,open-type=getPhoneNumber时有效1.2.0
binderroreventhandle 当使用开放能力时,发生错误的回调,open-type=launchApp时有效1.9.5
bindopensettingeventhandle 在打开授权设置页后回调,open-type=openSetting时有效2.0.7
bindlaunchappeventhandle 打开 APP 成功的回调,open-type=launchApp时有效2.4.4

----------------------------------完。

Logo

北京人形旗下天工造物具身智能开源社区,聚焦具身天工与慧思开物两大平台

更多推荐