button组件的open-type设置为getPhoneNumber,点击时想先走一下本地逻辑?

小程序 文章 2021-04-02 15:02 3726 0 全屏看文

AI助手支持GPT4.0

button组件的open-type设置为getPhoneNumber,点击时想先走一下本地逻辑?The open-type of the button component is set to getPhoneNumber, do you want to go through the local logic when you click it?

button组件的open-type设置为getPhoneNumber,点击时想先走一下本地逻辑?

有一个需求,在用户点击立即登录按钮之前,应该判断一下该用户是否已经同意平台使用条款。但是点击按钮之后会直接获取用户电话信息之类的数据,可能用户没有勾选同意平台使用条款也会弹框。疑问就是能不能在点击后先做一件事情然后再确定是否弹框。例如在用户没勾选同意平台使用条款的时候弹窗提示需要同意。

具体请看图:

There is a need to judge whether the user has agreed to the terms of use of the platform before the user clicks the login now button. However, after you click the button, you will directly obtain data such as the user's phone information. Maybe the user does not check "agree" to the terms of use of the platform, and the box will pop up. The question is whether you can do something after clicking, and then determine whether to pop the box. For example, when the user does not check agree to the terms of use of the platform, the pop-up prompt needs to agree. Please refer to the figure for details

回答:

brave:
<button open-type="{{isAgree ? 'getPhoneNumber' : ''}}" bindgetphonenumber="onGetPhoneNumber">授权获取手机号</button>
peng:

简单点:open-type的值用字段控制,默认是空,选中同意是=getPhoneNumber,去掉反之。

Brother斌🎈:

直接在立即登录上面悬浮一个透明的按钮,勾选条款隐藏,否则显示不就行了

咕噜将军:我试下,好思路。感谢!
brave:这样做就有点麻烦了
Brother斌🎈:确实 我项目里就是你那种写法的 没想到第一感觉居然是悬浮按钮....

-EOF-

AI助手支持GPT4.0


国内超级便宜服务器

摸鱼人热门新闻聚合

钻级赞助商 我要加入

开发者在线工具

第三方支付技术请加QQ群

相关文章
webview中提示 wx.downloadFile is not a function?
特约子商户该产品权限已被冻结,请前往商户平台>产品中心检查后重试?
手机短信打开的普通的h5页面可以点击跳转到微信小程序吗?
微信公众号订阅号的粉丝可以转给服务号吗?
小程序昨天突然搜索不到了,请帮助看看怎么解决?
随便看看
阿里云com、cn域名续费优惠码(2020年3月可用) 2863
线上防疫题库正确答案 2932
线上防疫题库正确答案(多选题) 4825
微信设置不可以使用小程序(游戏小程序) 5634
adsense申请已经支付的订单回退的网址 3212
BT面板查看网站入口、账号密码的命令 6009
ucloud海外服务器超级优惠券 3274
根据您的消费情况,您的延停权益已发生变化,变更后的延停权益为延停额度20.00元 5831
为什么我们喜欢迈克尔杰克逊。 4164
阿里云com、cn域名续费优惠码(2020年5月可用) 3586