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

[其他] 请问widget 的脚本模式的内容如何在微信中应用?

[复制链接]
大麦 发表于 2016-3-11 18:30:17 | 显示全部楼层 |阅读模式
本帖最后由 karrman 于 2016-3-14 16:05 编辑

请问widget 的脚本模式的内容如何在微信中应用? 微信中看不到哈
karrman 发表于 2016-3-14 13:58:38 | 显示全部楼层
如果是脚本模式,是需要拼接html字符串;
请问你的脚本是怎么写呢?
回复

使用道具 举报

 楼主| 大麦 发表于 2016-3-14 14:19:41 | 显示全部楼层
karrman 发表于 2016-3-14 13:58
如果是脚本模式,是需要拼接html字符串;
请问你的脚本是怎么写呢?

代码如下:

#include "mf_oa_performance_service";
(function(){
        var username = getWebUser().getName();
        var p_domainid = getDomainid();
        var p_cnt = 0;
        var sql = "";
        var c1 = "";
        var a = "11e5-97f9-7df5ce8b-ac1d-a71ff75c2789";
        var d = "11e5-97f8-c3340d66-ac1d-a71ff75c2789";

        //请假申请
        sql = "select ITEM_APPLICANT,DOMAINID from tlk_t_bpm_hr_apply where statelabel <> '终止' and auditornames like  '%" + username + "%' union all select ITEM_APPLICANT,DOMAINID from tlk_t_bpm_hr_overtime_apply where statelabel <> '终止' and auditornames like  '%" + username + "%' union all select ITEM_APPLICANT,DOMAINID from tlk_t_bpm_hr_nightwork where statelabel <> '终止' and auditornames like  '%" + username + "%' union all select ITEM_APPLICANT,DOMAINID from tlk_t_bpm_hr_correction_apply where statelabel <> '终止' and auditornames like  '%" + username + "%' UNION ALL select ITEM_APPLICANT,DOMAINID from tlk_t_bpm_hr_travel_out_apply where statelabel <> '终止' and auditornames like '%" + username + "%' ";
       
        var process = getDocProcess(a);
        p_cnt = process.countBySQL(sql, d);

        if (p_cnt == null || p_cnt == "") {
            p_cnt = "0";
        }

        c1 = "<a href='/obpm/portal/dynaform/view/displayViewWithPermission.action?_viewid=11e5-bbfc-19e5520d-96d3-43516d36ece4&amp;clearTemp=true&amp;application=11e5-97f9-7df5ce8b-ac1d-a71ff75c2789&amp;_resourceid=11e5-bbfc-75372930-96d3-43516d36ece4'>考勤待办数 (<b style='color:red'>" + p_cnt + "</b>)</a>";
        //费用申请
        p_cnt=0;
        sql = "SELECT *,statelabel item_statelabel from tlk_t_bpm_finance_apply where statelabel <> '终止' and AUDITORNAMES like '%"+username+"%' ";
        p_cnt = process.countBySQL(sql, d);
        c1 = c1+ "<br> <a href='/obpm/portal/dynaform/view/displayViewWithPermission.action?_viewid=11e5-b815-c15b7b85-8cca-a5f9b17ee71b&amp;clearTemp=true&amp;application=11e5-97f9-7df5ce8b-ac1d-a71ff75c2789&amp;_resourceid=11e5-b831-a28d84c7-a168-a9fbd1b69a98'>费用申请待办数 (<b style='color:red'>" + p_cnt + "</b>)</a>";
        c1;
回复

使用道具 举报

karrman 发表于 2016-3-14 16:05:46 | 显示全部楼层
如果你需要返回2个跳转的链接地址,只能用计算脚本的方式,一定是需要拼接html的,如下
        var  linkaddress="<html><head><title>Insert title here</title></head><body><div><a href='http://www.baidu.com'>考勤待办数 </a><br><a href='http://www.qq.com'>qq </a></div></body></html>";
linkaddress;
3.jpg
回复

使用道具 举报

 楼主| 大麦 发表于 2016-3-14 17:04:51 | 显示全部楼层
karrman 发表于 2016-3-14 16:05
如果你需要返回2个跳转的链接地址,只能用计算脚本的方式,一定是需要拼接html的,如下
        var  linkaddress ...

widget的计算脚本无法在微信上显示,请问有其他方案在微信首页增加信息吗?
回复

使用道具 举报

本版积分规则

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

GMT+8, 2026-8-14 08:14

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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