找回密码
 注册成为天翎用户
查看: 1180|回复: 2

[已解决] 发送信息到微信通知访问页面

[复制链接]
wizool 发表于 2017-7-20 14:12:05 | 显示全部楼层 |阅读模式
在保存动作后写脚本,发送信息到微信通知,然后微信端可以点击信息后直接访问查看详情。发送失败什么原因







补充内容 (2017-7-20 14:12):
(function(){
var   userids=getCurrentDocument().getItemValueAsString("xtr");//表单,获取接收人的值
var touser="";
if(userids!=""&&userids!=null){
         userids = userids.split(';');
            ...
karrman 发表于 2017-7-25 13:53:14 | 显示全部楼层
问题已解决,请参考
  1. (function(){
  2. var  userids=getCurrentDocument().getItemValueAsString("xtr");//表单,获取接收人的值
  3. var touser="";
  4. if(userids!=""&&userids!=null){
  5.          userids = userids.split(';');
  6.                  for (var i=0; i < userids.length; i++ ) {
  7.                  var touserid=userids[i];
  8.                     touser+=getUserById(touserid).getLoginno()+"|";
  9.            }
  10.     touser=touser.substring(0,touser.length-1);
  11. }
  12. var formid=getCurrentDocument().getFormid();
  13. var applicationId=getApplication();
  14. var domainId=getDomainid();
  15. var docid=getCurrentDocument().getId();
  16. var request =   $WEB.getParamsTable().getHttpRequest();//获取当前request
  17. var url12="/portal/phone/main.jsp?application="+applicationId+"&action=null&returnUrl=null&jumpToUrl=";

  18. var  url0="http://"+request.getServerName()+":"+request.getServerPort()+getContextPath();
  19. var url13 = "/"+getContextPath()+"/portal/dynaform/document/view.action?_docid="+docid+"&_formid="+formid+"&application="+applicationId+"&openType=from_weixin_message";
  20. url13=encodeURIComponent(url13);
  21. var url1=url0+url12+url13;
  22. //打开的url需要转码
  23. url1=encodeURIComponent(url1);
  24. var url ="https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxab253734733d50ed&redirect_uri="+url1+"&response_type=code&scope=snsapi_base&state="+domainId+"#wechat_redirect";
  25. println("urlWETCHAT==============="+url);
  26. var title="发送的标题";
  27. var description="发送的内容";
  28. var   picUrl=url0+"/resource/image/photo.png";
  29. var   flag=sendWeixinRichTextMessage(touser,title,description,url,picUrl,domainId,applicationId);
  30.   println("flag======"+flag)
  31.          return "";
  32. })()
复制代码
回复

使用道具 举报

kelly 发表于 2017-8-3 13:55:19 | 显示全部楼层
您好,获取接收人的值为:用户+"|"
回复

使用道具 举报

本版积分规则

手机版|天翎MyApps技术社区 ( 粤ICP备11093750号 )

GMT+8, 2026-8-13 23:15

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表