wx_push_message.lview 2.12 KB
Newer Older
Spencer Chang's avatar
Spencer Chang committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: syj
    $Date: 2016年3月3日14:49:39
    $Revision: 1.0  
    $Purpose:   
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">
    <a:init-procedure><![CDATA[
    ]]></a:init-procedure>
    <a:view>
        <a:dataSets>
            <a:dataSet id="send_message_ds" fetchAll="true" loadData="true" model="hls_weixin.wx_send_message_query"><![CDATA[
            ]]></a:dataSet>
        </a:dataSets>
        <a:screenBody><![CDATA[
        ]]></a:screenBody>
        <script type="text/javascript"><![CDATA[
            function send_message() {
                var ds = $('send_message_ds');
                var length = ds.getAll().length;
            
                var param;
                for (var i = 0;i < length;i++) {
                    record = ds.getAt(i);
                    param = {
                        'touser': record.get('touser'),
                        'title': record.get('title'),
                        'msg_body': record.get('msg_body')
                    };
                }
            
                /* Leaf.request({
                 url: 'wx_push_message.lsc',
                 para: param,
                 success: function success(data) {},
                 failure: function() {
                 },
                 error: function() {
                 },
                 scope: this
                 }); */
            
                Ext.Ajax.request({
                    url: 'http://songyongjian.imwork.net/wx/send_message.lsc',
                    params: {
                        _request_data: Ext.util.JSON.encode({
                            parameter: param
                        })
                    },
                    failure: function(e) {
                        //  failFunction();

            
                    },
                    success: function(res) {
                        //successFunction(res);
                    }
                });
            
            
            
            
            
            }
            send_message();
        ]]></script>
    </a:view>
</a:screen>