123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713 |
- <?php
- /**
- * [WeEngine System] Copyright (c) 2014 WE7.CC
- * WeEngine is NOT a free software, it under the license terms, visited http://www.we7.cc/ for more details.
- */
- $_W['page']['title'] = '模拟测试';
- $development = 1;
- $accounts = uni_owned(0, false);
- define('FRAME', '');
- template('common/header');
- ?>
- <style type="text/css">
- .chatPanel .left{float:left;}
- .chatPanel .right{float:right;}
- .chatPanel .media a{display:block;}
- .chatPanel .media{border:1px solid #cdcdcd;box-shadow:0 3px 6px #999999;-webkit-border-radius:12px;-moz-border-radius:12px;border-radius:12px;width:285px;background-color:#FFFFFF;background:-webkit-gradient(linear,left top,left bottom,from(#FFFFFF),to(#FFFFFF));background-image:-moz-linear-gradient(top,#FFFFFF 0%,#FFFFFF 100%);margin:0px auto;}
- .chatPanel .media .mediaPanel{padding:0px;margin:0px;}
- .chatPanel .media .mediaImg{margin:25px 15px 15px;width:255px;position:relative;}
- .chatPanel .media .mediaImg .mediaImgPanel{position:relative;padding:0px;margin:0px;max-height:164px;overflow:hidden;}
- .chatPanel .media .mediaImg img{/* width:100%;height:164px;position:absolute;left:0px;*/width:255px;}
- .chatPanel .media .mediaImg .mediaImgFooter{position:absolute;bottom:0;height:29px;background-color:#000;background-color:rgba(0,0,0,0.4);text-shadow:none;color:#FFF;text-align:left;padding:0px 11px;line-height:29px;width:233px;}
- .chatPanel .media .mediaImg .mediaImgFooter a:hover p{color:#B8B3B3;}
- .chatPanel .media .mediaImg .mediaImgFooter .mesgTitleTitle{line-height:28px;color:#FFF;max-width:240px;height:26px;white-space:nowrap;text-overflow:ellipsis;-o-text-overflow:ellipsis;overflow:hidden;width:240px;}
- .chatPanel .media .mesgIcon{display:inline-block;height:19px;width:13px;margin:8px 0px -2px 4px;}
- .chatPanel .media .mediaContent{margin:0px;padding:0px;}
- .chatPanel .media .mediaContent .mediaMesg{border-top:1px solid #D7D7D7;padding:10px;}
- .chatPanel .media .mediaContent .mediaMesg .mediaMesgDot{display:block;position:relative;top:-3px;left:20px;height:6px;width:6px;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;}
- .chatPanel .media .mediaContent .mediaMesg .mediaMesgTitle:hover p{color:#1A1717;}
- .chatPanel .media .mediaContent .mediaMesg .mediaMesgTitle a{color:#707577;}
- .chatPanel .media .mediaContent .mediaMesg .mediaMesgTitle a:hover p{color:#444440;}
- .chatPanel .media .mediaContent .mediaMesg .mediaMesgIcon{}
- .chatPanel .media .mediaContent .mediaMesg .mediaMesgTitle p{line-height:1.5em;max-height:45px;max-width:220px;min-width:176px;margin-top:2px;color:#5D6265;text-overflow:ellipsis;-o-text-overflow:ellipsis;overflow:hidden;text-align:left;text-overflow:ellipsis;}
- .chatPanel .media .mediaContent .mediaMesg .mediaMesgIcon img{height:45px;width:45px;}
- /*media mesg detail*/
- .chatPanel .media .mediaHead{/*height:48px;*/padding:0px 15px 4px;border-bottom:0px solid #D3D8DC;color:#000000;font-size:20px;}
- .chatPanel .media .mediaHead .title{line-height:1.2em;margin-top:22px;display:block;max-width:312px;text-align:left;/*height:25px;white-space:nowrap;text-overflow:ellipsis;-o-text-overflow:ellipsis;overflow:hidden;*/}
- .chatPanel .mediaFullText .mediaImg{width:255px;padding:0;margin:0 15px;overflow:hidden;max-height:164px;}
- .chatPanel .mediaFullText .mediaImg img{/*margin-top:17px;position:absolute;*/}
- .chatPanel .mediaFullText .mediaContent{padding:0 0 8px;font-size:16px;line-height:1.5em;text-align:left;color:#222222;}
- .chatPanel .mediaFullText .mediaContentP{margin:12px 15px 0px; word-break: break-all;}
- .chatPanel .media .mediaHead .time{margin:0px;margin-top:21px;color:#8C8C8C;background:none;width:auto;font-size:12px;}
- .chatPanel .media .mediaFooter{-webkit-border-radius:0px 0px 12px 12px;-moz-border-radius:0px 0px 12px 12px;border-radius:0px 0px 12px 12px;padding:0px;}
- .chatPanel .media .mediaFooter a{color:#222222;font-size:16px;padding:0;}
- .chatPanel .media .mediaFooter .mesgIcon{margin:15px 3px 0px 0px;}
- .chatPanel .media .mediaFooterbox{border-top:1px #CCC solid;}
- .chatPanel .media a:hover{cursor:pointer;}
- .chatPanel .media a:hover .mesgIcon{}
- .mediaContent a:hover{background-color:#F6F6F6;}
- .mediaContent .last:hover{-webkit-border-radius:0px 0px 12px 12px;-moz-border-radius:0px 0px 12px 12px;border-radius:0px 0px 12px 12px;background-color:#F6F6F6;}
- .mediaFullText:hover{background-color:#F6F6F6;background:-webkit-gradient(linear,left top,left bottom,from(#F6F6F6),to(#F6F6F6));background-image:-moz-linear-gradient(top,#F6F6F6 0%,#F6F6F6 100%);}
- .chatItem a{text-decoration:none;}.chatItem a:hover{text-decoration:none;}.mediaFooterbox{cursor:pointer; padding:0 15px;}
- #svinfolist{display:none;}#svinfolist p{border-top:1px #CCC solid; padding:4px 6px;word-break:break-all; white-space:pre; margin:2px; cursor:pointer;}
- #svinfolist p img{width:50px;height:50px;}
- .btn{white-space:normal;box-sizing:content-box;}
- </style>
- <div class="panel panel-content">
- <div class="content-head panel-heading">
- <span class="font-lg">模拟测试</span>
- </div>
- <div class="panel-body">
- <div class="col-sm-8">
- <form action="" method="get" class="form-horizontal form">
- <div class="page-header">
- <h4>模拟测试</h4>
- </div>
- <div class="form-group">
- <label class="col-xs-12 col-sm-2 col-md-2 control-label"></label>
- <div class="col-sm-10 col-xs-12">
- <input name="submit" type="button" onclick="submitform()" value="发送" class="btn btn-primary" style="margin-right:15px">
- <input name="submit" type="button" onclick="submitprocess()" value="查看触发过程" class="btn btn-success">
- </div>
- </div>
- <div class="form-group">
- <label class="col-xs-12 col-sm-2 col-md-2 control-label">公众号</label>
- <div class="col-sm-10 col-xs-12">
- <select name="account" id="account" class="form-control">
- <?php
- foreach($accounts as $account) {
- ?>
- <?php
- if(!empty($account)) {
- $timestamp = TIMESTAMP;
- $nonce = random(5);
- $token = $account['token'];
- $signkey = array($token, TIMESTAMP, $nonce);
- sort($signkey, SORT_STRING);
- $signString = implode($signkey);
- $signString = sha1($signString);
- ?>
- <?php if($development == 1) { ?>
- <option <?php if ($_W['uniacid'] == $account['uniacid']) { ?>selected<?php } ?> value="<?php echo '../api.php?id='.$account['uniacid'] ?>×tamp=<?php echo $timestamp ?>&nonce=<?php echo $nonce ?>&signature=<?php echo $signString ?>"><?php echo $account['name']?></option>
- <?php } else { ?>
- <option <?php if ($_W['uniacid'] == $account['uniacid']) { ?>selected<?php } ?> value="<?php echo $account['uniacid'];?>"><?php echo $account['name'] ?></option>
- <?php } ?>
- <?php
- }
- ?>
- <?php
- }
- ?>
- </select>
- </div>
- </div>
- <div class="form-group">
- <label class="col-xs-12 col-sm-2 col-md-2 control-label">消息类型</label>
- <div class="col-sm-10 col-xs-12">
- <div class="radio-inline"><input type="radio" name="type" value="text" id="type_text" onclick="toggle('text')" checked="checked" /><label for="type_text"> 文本</label></div>
- <div class="radio-inline"><input type="radio" name="type" value="image" id="type_image" onclick="toggle('image')" /><label for="type_image"> 图片</label></div>
- <div class="radio-inline"><input type="radio" name="type" value="location" id="type_location" onclick="toggle('location')" /><label for="type_location"> 位置</label></div>
- <div class="radio-inline"><input type="radio" name="type" value="link" id="type_link" onclick="toggle('link')" /><label for="type_link"> 链接</label></div>
- <div class="radio-inline"><input type="radio" name="type" value="event" id="type_event" onclick="toggle('event')" /><label for="type_event"> 菜单</label></div>
- <div class="radio-inline"><input type="radio" name="type" value="subscribe" id="type_subscribe" onclick="toggle('subscribe')" /><label for="type_subscribe"> 模拟关注</label></div>
- <div class="radio-inline"><input type="radio" name="type" value="unsubscribe" id="type_unsubscribe" onclick="toggle('unsubscribe')" /><label for="type_unsubscribe"> 取消关注</label></div>
- <div class="radio-inline"><input type="radio" name="type" value="other" id="type_other" onclick="toggle('other')" /><label for="type_other"> 其他</label></div>
- </div>
- </div>
- <div class="form-group">
- <label class="col-xs-12 col-sm-2 col-md-2 control-label">发送用户</label>
- <div class="col-sm-10 col-xs-12">
- <input type="text" id="fromuser" value="fromUser" class="form-control" />
- </div>
- </div>
- <div class="form-group">
- <label class="col-xs-12 col-sm-2 col-md-2 control-label">接收用户</label>
- <div class="col-sm-10 col-xs-12">
- <input type="text" id="touser" value="toUser" class="form-control" />
- </div>
- </div>
- <div class="form-group content_type" id="text">
- <label class="col-xs-12 col-sm-2 col-md-2 control-label">内容</label>
- <div class="col-sm-10 col-xs-12">
- <textarea id="contentvalue" rows="5" cols="50" class="form-control">测试内容</textarea>
- </div>
- </div>
- <div class="form-group content_type" id="image">
- <label class="col-xs-12 col-sm-2 col-md-2 control-label">图片</label>
- <div class="col-sm-10 col-xs-12">
- <input type="text" id="picurl" value="http://www.baidu.com/img/bdlogo.gif" class="form-control" />
- </div>
- </div>
- <div id="location" class="content_type">
- <div class="form-group">
- <label class="col-xs-12 col-sm-2 col-md-2 control-label">X坐标</label>
- <div class="col-sm-10 col-xs-12">
- <input type="text" id="location_x" class="form-control" value="23.134521" />
- </div>
- </div>
- <div class="form-group" >
- <label class="col-xs-12 col-sm-2 col-md-2 control-label">Y坐标</label>
- <div class="col-sm-10 col-xs-12">
- <input type="text" id="location_y" class="form-control" value="113.358803" />
- </div>
- </div>
- </div>
- <div class="form-group content_type" id="link">
- <label class="col-xs-12 col-sm-2 col-md-2 control-label">链接</label>
- <div class="col-sm-10 col-xs-12">
- <input type="text" id="url" class="form-control" value="http://baidu.com" />
- </div>
- </div>
- <div class="form-group content_type" id="event">
- <label class="col-xs-12 col-sm-2 col-md-2 control-label">EventKey</label>
- <div class="col-sm-10 col-xs-12">
- <input type="text" id="event_key" class="form-control" value="EVENTKEY" />
- </div>
- </div>
- <div class="form-group">
- <label class="col-xs-12 col-sm-2 col-md-2 control-label">发送消息</label>
- <div class="col-sm-10 col-xs-12">
- <textarea id="sendxml" rows="10" cols="50" class="form-control" readonly="readonly"></textarea>
- </div>
- </div>
- <div class="form-group" style="display:none" id="process">
- <label class="col-xs-12 col-sm-2 col-md-2 control-label">处理过程</label>
- <div class="col-sm-10 col-xs-12 table-responsive">
- </div>
- </div>
- <div class="form-group">
- <label class="col-xs-12 col-sm-2 col-md-2 control-label">接收消息</label>
- <div class="col-sm-10 col-xs-12">
- <pre id="receive"></pre>
- </div>
- </div>
- </form>
- </div>
- <div class="col-sm-4" id="demoSendBox">
- <div class="chatPanel form" style="width:300px;">
- <div class="page-header">
- <h4>预览效果</h4>
- </div>
- <div id="svposttext" style="text-align:left; padding-bottom:10px;display:none;">
- <img src="./resource/images/noavatar_middle.gif" style="width:34px;height:34px;margin-right:6px;float:right;" class="img-rounded">
- <div id="svpostinfo" class="btn btn-success" style="margin-right: 4px;float: right;max-width: 184px;text-align:left;">发送内容</div>
- <div style="clear:both;"></div>
- </div>
-
- <div class="chatItem you">
- <div id="svtext" style="text-align:left; padding-bottom:10px;display:none;">
- <img src="./resource/images/noavatar_middle.gif" style="width:34px;height:34px;margin-left:6px; float:left;" class="img-rounded">
- <div class="btn btn-success" style="margin-left: 4px;float: left;max-width: 184px;text-align:left;">回复内容</div>
- <div style="clear:both;"></div>
- </div>
-
- <div id="svurlbox" style="display:none;">
- <div class="media mediaFullText">
- <div class="mediaPanel">
- <a href="javascript:;" id="svurl" target="_blank">
- <div class="mediaHead"><span class="title" id="svtitle">标题</span><span class="time"><?php echo date('m月d日'); ?></span>
- <div class="clr"></div>
- </div>
- <div class="mediaImg"><img id="svpic" src=""></div>
- <div class="mediaContent mediaContentP"><p id="svinfo"></p></div>
- </a>
- <div id="svinfolist"></div>
- <div class="mediaFooter">
- <div class="mediaFooterbox clearfix" onclick="opensvurl();">
- <span class="mesgIcon right">></span>
- <span style="line-height:50px;" class="left">查看全文</span>
- </div>
- <div class="clr"></div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <?php
- if($development == 1) {?>
- <script type="text/javascript">
- require(['jquery'], function($){
- $('.content_type').hide();
- $('#text').show();
- toggle('text');
- });
- function opensvurl(){
- var href=$("#svurl").attr("href");
- window.open(href, "_blank");
- }
- function popensvurl(href){
- if(href)window.open(href, "_blank");
- }
- function toggle(type) {
- curtype = type;
- $('.content_type').hide();
- $("#" + curtype).show();
- buildRequest(type);
- $('#receive').text('');
- $('#svposttext').hide();
- $('#svtext').hide();
- $('#svurlbox').hide();
- $('#sendxml').attr('readonly', 'readonly');
- if(type == 'other') {
- $('#sendxml').removeAttr('readonly');
- }
- }
- function getxml(xmlstring){
- var xmlobject = null;
- try{
- if(window.ActiveXObject){
- xmlobject =new ActiveXObject("Microsoft.XMLDOM");
- xmlobject.async="false";
- xmlobject.loadXML(xmlstring);
- }else{// 用于 Mozilla, Firefox, Opera, 等浏览器的代码:
- var parser=new DOMParser();
- xmlobject =parser.parseFromString(xmlstring,"text/xml");
- }
- }catch(e){alert("您的浏览器不支持模拟测试");}
- return xmlobject;
- }
- function buildRequest(type) {
- var $demoSendBox = $('#demoSendBox');
- $('span.time', $demoSendBox).show();
- $('div.mediaImg', $demoSendBox).show();
- $('div.mediaContent', $demoSendBox).show();
- $('div.mediaFooterbox', $demoSendBox).show();
- var time = Math.round(new Date().getTime()/1000);
- xml = "<xml>\n"+
- "<ToUserName><![CDATA["+$('#touser').val()+"]]></ToUserName>\n"+
- "<FromUserName><![CDATA["+$('#fromuser').val()+"]]></FromUserName>\n"+
- "<CreateTime>"+time+"</CreateTime>\n";
- if (type == 'text') {
- xml += "<MsgType><![CDATA[text]]></MsgType>\n";
- xml += "<Content><![CDATA["+$('#contentvalue').val()+"]]></Content>\n";
- $('#svpostinfo').text($('#contentvalue').val());
- } else if (type == 'image') {
- xml += "<MsgType><![CDATA[image]]></MsgType>\n";
- xml += "<PicUrl><![CDATA["+$('#picurl').val()+"]]></PicUrl>";
- $('#svpostinfo').html('<img src="'+$('#picurl').val()+'">');
- } else if (type == 'location') {
- xml += "<MsgType><![CDATA[location]]></MsgType>\n";
- xml += "<Location_X>"+parseFloat($('#location_x').val())+"</Location_X>\n";
- xml += "<Location_Y>"+parseFloat($('#location_y').val())+"</Location_Y>\n";
- xml += "<Scale>20</Scale>\n";
- xml += "<Label><![CDATA[位置信息]]></Label>\n";
- $('span.time', $demoSendBox).hide();
- $('div.mediaImg', $demoSendBox).hide();
- $('div.mediaContent', $demoSendBox).hide();
- $('#svpostinfo').html('<img src="data:image/jpg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAcEBAQFBAcFBQcKBwUHCgwJBwcJDA0LCwwLCw0RDQ0NDQ0NEQ0PEBEQDw0UFBYWFBQeHR0dHiIiIiIiIiIiIiL/2wBDAQgHBw0MDRgQEBgaFREVGiAgICAgICAgICAgICAhICAgICAgISEhICAgISEhISEhISEiIiIiIiIiIiIiIiIiIiL/wAARCABvAMgDAREAAhEBAxEB/8QAHAABAAEFAQEAAAAAAAAAAAAAAAMBAgQFBgcI/8QATBAAAAUBAwYIC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W19Og/FZ74AeLa+nQfis98AFcG19cJ/MfjM98GCJPBtfrU+Y+vyzHfHy01Pe4mkrEvi2vrT6j8Znvj6jMqfBvfTV+Y8mnyrPfAFPFtfWv1H4rHfAFU8G99MZVg6P9VjvgCE+DW/VfqPxmO+LqxVlPFrfroPxme+J4EDxa366D8ZjviHYkkf4Nr7ZTUg6KeeY74iJLI/FrfroPxme+LcCo8Wt+ug/GZ74cAPFrfroPxme+HADxa366D8ZnvhwA8Wt+ug/GZ74cAPFrfroPxme+HAFfFrfroPxme+HAHo3BBwVWpYlpfKC3MKZCUGiJHSol0xlRS1GWjZooKtkpH//Z">');
- } else if (type == 'link') {
- xml += "<MsgType><![CDATA[link]]></MsgType>\n";
- xml += "<Title><![CDATA[测试链接]]></Title>\n";
- xml += "<Description><![CDATA[测试链接描述]]></Description>\n";
- xml += "<Url><![CDATA["+$('#url').val()+"]]></Url>\n";
- } else if (type == 'subscribe') {
- xml += "<MsgType><![CDATA[event]]></MsgType>\n";
- xml += "<Event><![CDATA[subscribe]]></Event>\n";
- xml += "<EventKey><![CDATA[]]></EventKey>\n";
- } else if (type == 'unsubscribe') {
- xml += "<MsgType><![CDATA[event]]></MsgType>\n";
- xml += "<Event><![CDATA[unsubscribe]]></Event>\n";
- xml += "<EventKey><![CDATA[]]></EventKey>\n";
- } else if (type == 'event') {
- xml += "<MsgType><![CDATA[event]]></MsgType>\n";
- xml += "<Event><![CDATA[CLICK]]></Event>\n";
- xml += "<EventKey><![CDATA["+$('#event_key').val()+"]]></EventKey>\n";
- }
- xml += "<MsgId>1234567890123456</MsgId>\n"+
- "</xml>";
- if(type == 'other') {
- xml = $('#sendxml').val();
- }
- $('#sendxml').val(xml);
- }
- function submitprocess() {
- buildRequest(curtype);
- $('#svtext').hide();$('#svurlbox').hide();$('#svinfolist').hide();
- $('div.mediaFooterbox', $('#demoSendBox')).show();
- var url = $('#account').val() + '&debug=1';
- $.ajax(url, {
- type : 'POST',
- headers : {"Content-type" : "text/xml"},
- data : $('#sendxml').val().replace(/[\r\n]/g,""),
- beforeSend : function(){
- if(curtype!='subscribe' && curtype!='unsubscribe'){
- if(curtype=='text' || curtype=='image' || curtype == 'location'){
- $('#svposttext').show();
- }
- }
- $('#receive').text('加载中。。。');
- }
- }).done(function(data){
- var data = $.parseJSON(data);
- var s = data.resp;
- var p = data.process;
- if(1 || curtype!='unsubscribe'){
- var xmlobject = getxml(s);
- if(xmlobject){
- var xmlobj = xmlobject.getElementsByTagName("xml");
- if(xmlobj.length){
- var xmls = xmlobj.item(0);
- var xml = xmls;
- if (xml.getElementsByTagName("FromUserName").length > 0) {
- var FromUserName = xml.getElementsByTagName("FromUserName")[0].firstChild.nodeValue;
- var ToUserName = xml.getElementsByTagName("ToUserName")[0].firstChild.nodeValue;
- var MsgType = xml.getElementsByTagName("MsgType")[0].firstChild.nodeValue;
- } else {
- var MsgType = 'text';
- var Content = '';
- }
- if(MsgType=='text'){
- if (xml.getElementsByTagName("FromUserName").length > 0) {
- var Content = xml.getElementsByTagName("Content")[0].firstChild.nodeValue;
- } else {
- var Content = '';
- }
- Content = nl2br(Content);
- Content = Content.replace('./index', "../app/index");
- Content && $('#svtext').show().find('div.btn').html(Content);
- }else if(MsgType == 'news'){
- var Title = xml.getElementsByTagName("Title")[0].firstChild.nodeValue;
- var Description = xml.getElementsByTagName("Description")[0].firstChild.nodeValue;
- var PicUrl = xml.getElementsByTagName("PicUrl")[0].firstChild.nodeValue;
- var Url = xml.getElementsByTagName("Url")[0].firstChild.nodeValue;
- if(Url.indexOf('http://') == -1 && Url.indexOf('https://') == -1) {
- Url = '../app/' + Url;
- }
- $('#svtitle').html(Title);
- $('#svinfo').html(Description);
- $('#svpic').attr('src', PicUrl);
- $('#svurlbox').show().find('a#svurl').attr('href', Url);
- var titleObj = xml.getElementsByTagName("Title");
- if(titleObj.length>1){
- var svinfolist = imghtml = '';
- var UrlObj = xml.getElementsByTagName("Url");
- var PicUrlObj = xml.getElementsByTagName("PicUrl");
- for(var ti=1;ti<titleObj.length;ti++){
- imghtml = PicUrlObj[ti].firstChild.nodeValue ? '<img align="right" src="'+PicUrlObj[ti].firstChild.nodeValue+'">' : '';
- svinfolist += '<p class="clearfix" onclick="popensvurl(\''+UrlObj[ti].firstChild.nodeValue+'\')">'+titleObj[ti].firstChild.nodeValue+imghtml+'</p>';
- }
- $('div.mediaFooterbox', $('#demoSendBox')).hide();
- $('#svinfolist').show().html(svinfolist);
- }
- }
- }
- }
- $('#receive').text(s);
- }else{
- $('#receive').text('模拟取消关注成功');
- }
- $('#process').find('div').html(p);
- $('#process').show();
- });
- }
- function submitform() {
- $('#process').hide();
- buildRequest(curtype);
- $('#svtext').hide();$('#svurlbox').hide();$('#svinfolist').hide();
- $('div.mediaFooterbox', $('#demoSendBox')).show();
- $.ajax($('#account').val(), {
- type : 'POST',
- headers : {"Content-type" : "text/xml"},
- data : $('#sendxml').val().replace(/[\r\n]/g,""),
- beforeSend : function(){
- if(curtype!='subscribe' && curtype!='unsubscribe'){
- if(curtype=='text' || curtype=='image' || curtype == 'location'){
- $('#svposttext').show();
- }
- }
- $('#receive').text('加载中。。。');
- }
- }).done(function(s){
- if(1 || curtype!='unsubscribe'){
- var xmlobject = getxml(s);
- if(xmlobject){
- var xmlobj = xmlobject.getElementsByTagName("xml");
- if(xmlobj.length){
- var xmls = xmlobj.item(0);
- var xml = xmls;
- /* var FromUserName = xml.getElementsByTagName("FromUserName")[0].firstChild.nodeValue;
- var ToUserName = xml.getElementsByTagName("ToUserName")[0].firstChild.nodeValue;
- var MsgType = xml.getElementsByTagName("MsgType")[0].firstChild.nodeValue; */
- if (xml.getElementsByTagName("FromUserName").length > 0) {
- var FromUserName = xml.getElementsByTagName("FromUserName")[0].firstChild.nodeValue;
- var ToUserName = xml.getElementsByTagName("ToUserName")[0].firstChild.nodeValue;
- var MsgType = xml.getElementsByTagName("MsgType")[0].firstChild.nodeValue;
- } else {
- var MsgType = 'text';
- var Content = '';
- }
- if(MsgType=='text'){
- if (xml.getElementsByTagName("FromUserName").length > 0) {
- var Content = xml.getElementsByTagName("Content")[0].firstChild.nodeValue;
- } else {
- var Content = '';
- }
- Content = nl2br(Content);
- Content = Content.replace('./index', "../app/index");
- Content && $('#svtext').show().find('div.btn').html(Content);
- }else if(MsgType == 'news'){
- var Title = xml.getElementsByTagName("Title")[0].firstChild.nodeValue;
- var Description = xml.getElementsByTagName("Description")[0].firstChild.nodeValue;
- var PicUrl = xml.getElementsByTagName("PicUrl")[0].firstChild.nodeValue;
- var Url = xml.getElementsByTagName("Url")[0].firstChild.nodeValue;
- if(Url.indexOf('http://') == -1 && Url.indexOf('https://') == -1) {
- Url = '../app/' + Url;
- }
- $('#svtitle').html(Title);
- $('#svinfo').html(Description);
- $('#svpic').attr('src', PicUrl);
- $('#svurlbox').show().find('a#svurl').attr('href', Url);
- var titleObj = xml.getElementsByTagName("Title");
- if(titleObj.length>1){
- var svinfolist = imghtml = '';
- var UrlObj = xml.getElementsByTagName("Url");
- var PicUrlObj = xml.getElementsByTagName("PicUrl");
- for(var ti=1;ti<titleObj.length;ti++){
- imghtml = PicUrlObj[ti].firstChild.nodeValue ? '<img align="right" src="'+PicUrlObj[ti].firstChild.nodeValue+'">' : '';
- svinfolist += '<p class="clearfix" onclick="popensvurl(\''+UrlObj[ti].firstChild.nodeValue+'\')">'+titleObj[ti].firstChild.nodeValue+imghtml+'</p>';
- }
- $('div.mediaFooterbox', $('#demoSendBox')).hide();
- $('#svinfolist').show().html(svinfolist);
- }
- }
- }
- }
- $('#receive').text(s);
- }else{
- $('#receive').text('模拟取消关注成功');
- }
- })
- }
- function nl2br(str, is_xhtml) {
- var breakTag = (is_xhtml || typeof is_xhtml === 'undefined') ? '<br ' + '/>' : '<br>'; // Adjust comment to avoid issue on phpjs.org display
- return (str + '').replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1' + breakTag + '$2');
- }
- </script>
- <?php } else { ?>
- <script type="text/javascript">
- require(['jquery'], function($){
- $('.content_type').hide();
- $('#text').show();
- toggle('text');
- });
- function opensvurl(){
- var href=$("#svurl").attr("href");
- window.open(href, "_blank");
- }
- function popensvurl(href){
- if(href)window.open(href, "_blank");
- }
- function toggle(type) {
- curtype = type;
- $('.content_type').hide();
- $("#" + curtype).show();
- buildRequest(type);
- $('#receive').text('');
- $('#svposttext').hide();
- $('#svtext').hide();
- $('#svurlbox').hide();
- $('#sendxml').attr('readonly', 'readonly');
- if(type == 'other') {
- $('#sendxml').removeAttr('readonly');
- }
- }
- function getxml(xmlstring){
- var xmlobject = null;
- try{
- if(window.ActiveXObject){
- xmlobject =new ActiveXObject("Microsoft.XMLDOM");
- xmlobject.async="false";
- xmlobject.loadXML(xmlstring);
- }else{// 用于 Mozilla, Firefox, Opera, 等浏览器的代码:
- var parser=new DOMParser();
- xmlobject =parser.parseFromString(xmlstring,"text/xml");
- }
- }catch(e){alert("您的浏览器不支持模拟测试");}
- return xmlobject;
- }
- function buildRequest(type) {
- var $demoSendBox = $('#demoSendBox');
- $('span.time', $demoSendBox).show();
- $('div.mediaImg', $demoSendBox).show();
- $('div.mediaContent', $demoSendBox).show();
- $('div.mediaFooterbox', $demoSendBox).show();
- var time = Math.round(new Date().getTime()/1000);
- xml = "<xml>\n"+
- "<ToUserName><![CDATA["+$('#touser').val()+"]]></ToUserName>\n"+
- "<FromUserName><![CDATA["+$('#fromuser').val()+"]]></FromUserName>\n"+
- "<CreateTime>"+time+"</CreateTime>\n";
- if (type == 'text') {
- xml += "<MsgType><![CDATA[text]]></MsgType>\n";
- xml += "<Content><![CDATA["+$('#contentvalue').val()+"]]></Content>\n";
- $('#svpostinfo').text($('#contentvalue').val());
- } else if (type == 'image') {
- xml += "<MsgType><![CDATA[image]]></MsgType>\n";
- xml += "<PicUrl><![CDATA["+$('#picurl').val()+"]]></PicUrl>";
- $('#svpostinfo').html('<img src="'+$('#picurl').val()+'">');
- } else if (type == 'location') {
- xml += "<MsgType><![CDATA[location]]></MsgType>\n";
- xml += "<Location_X>"+parseFloat($('#location_x').val())+"</Location_X>\n";
- xml += "<Location_Y>"+parseFloat($('#location_y').val())+"</Location_Y>\n";
- xml += "<Scale>20</Scale>\n";
- xml += "<Label><![CDATA[位置信息]]></Label>\n";
- $('span.time', $demoSendBox).hide();
- $('div.mediaImg', $demoSendBox).hide();
- $('div.mediaContent', $demoSendBox).hide();
- $('#svpostinfo').html('<img src="data:image/jpg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAcEBAQFBAcFBQcKBwUHCgwJBwcJDA0LCwwLCw0RDQ0NDQ0NEQ0PEBEQDw0UFBYWFBQeHR0dHiIiIiIiIiIiIiL/2wBDAQgHBw0MDRgQEBgaFREVGiAgICAgICAgICAgICAhICAgICAgISEhICAgISEhISEhISEiIiIiIiIiIiIiIiIiIiL/wAARCABvAMgDAREAAhEBAxEB/8QAHAABAAEFAQEAAAAAAAAAAAAAAAMBAgQFBgcI/8QATBAAAAUBAwYICQkGBQUAAAAAAAECAwQRBQYSExQhIjFRBzJBUlSRktIVFyNTYXGToaMWJDM0N0JicoF0g7Gys9FDY3OCwQglNUTh/8QAGgEBAAMBAQEAAAAAAAAAAAAAAAECAwUGBP/EADARAAIBAgMHBAEEAgMAAAAAAAABAgMRExRSBBIhMVFhkQUyQXEiIzRCgTOhscHx/9oADAMBAAIRAxEAPwD3yfPzeiElVZ+4UnOxWUrGF4Wmb09QyxGU32PC03enqDEY32PC03enqDEY32PC03enqDEY32PC03enqDEY32PC03enqDEY32WuWxOS2pRGmpEZ7BWdaSi32JjK7MVF4rTNEUzNFXTIl6voHC2T1ivOpGLtZ9jpV9mhGDa+DLVbE0kmdU6C3D0CqM5m+ZVoT5DBsZMy8o3jVUuXQLzlYvJ2MbwtN3p6hniMpvsljWlKcdwqMqeoXhNtkxkTuS3k0pTSZFsGpoHJbyUGoqVIgBR6Y+hhS00qRbgBLIfcRLcaTxEkky/Wv9gBGiW8eKtNB02AC7OXfQAGcu+gAM5d9AAZy76AAzl30AC12W8ls1FSpACZl/HoPaANZ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aVWnRo4wu7Xj82IOusxV4kWLOQ6xaqZCUtFGQ7MgreVRWtkVpLCkyLjZTaQxdr/APpJw8Rucm+96kzikNPPWDIVgmPNPO1NCEkZqa8nyaCLYQ3l7V9kGNfO4N7LwSbNlR4SWjYgR4klK5UXjs1KrdF6SMj5RMKqjcWOksOz7RVwzOWk7FyMRFlk22a3WVqwpImkqVk1KIjWaT0EYzlL9MfJ2pLXzT9o7/cfMWPLP+oSK8c2x5uDyObrZNda6+PFhOuts06R9uyPgysjzAfSVAAAAAAA6vgc+0yyf3/9BYsuRHyZvDx9orv7JG/gYqWOHAgAAAAAAClCAChACtABShACoApQgANKdwArQgJAAphIAVoBAoBIAACAAAAAAAOr4HPtMsn9/wD0Fiy5EfJ6Nws8GMu8rrdr2SpPhFlGTeaWeEnEFpTQ+QyFSx5efBrfUlGWY7P85nvgCni2vp0H4rPfADxbX06D8VnvgB4tr6dB+Kz3wA8W19Og/FZ74AeLa+nQfis98AFcG19cJ/MfjM98GCJPBtfrU+Y+vyzHfHy01Pe4mkrEvi2vrT6j8Znvj6jMqfBvfTV+Y8mnyrPfAFPFtfWv1H4rHfAFU8G99MZVg6P9VjvgCE+DW/VfqPxmO+LqxVlPFrfroPxme+J4EDxa366D8ZjviHYkkf4Nr7ZTUg6KeeY74iJLI/FrfroPxme+LcCo8Wt+ug/GZ74cAPFrfroPxme+HADxa366D8ZnvhwA8Wt+ug/GZ74cAPFrfroPxme+HAFfFrfroPxme+HAHo3BBwVWpYlpfKC3MKZCUGiJHSol0xlRS1GWjZooKtkpH//Z">');
- } else if (type == 'link') {
- xml += "<MsgType><![CDATA[link]]></MsgType>\n";
- xml += "<Title><![CDATA[测试链接]]></Title>\n";
- xml += "<Description><![CDATA[测试链接描述]]></Description>\n";
- xml += "<Url><![CDATA["+$('#url').val()+"]]></Url>\n";
- } else if (type == 'subscribe') {
- xml += "<MsgType><![CDATA[event]]></MsgType>\n";
- xml += "<Event><![CDATA[subscribe]]></Event>\n";
- xml += "<EventKey><![CDATA[]]></EventKey>\n";
- } else if (type == 'unsubscribe') {
- xml += "<MsgType><![CDATA[event]]></MsgType>\n";
- xml += "<Event><![CDATA[unsubscribe]]></Event>\n";
- xml += "<EventKey><![CDATA[]]></EventKey>\n";
- } else if (type == 'event') {
- xml += "<MsgType><![CDATA[event]]></MsgType>\n";
- xml += "<Event><![CDATA[CLICK]]></Event>\n";
- xml += "<EventKey><![CDATA["+$('#event_key').val()+"]]></EventKey>\n";
- }
- xml += "<MsgId>1234567890123456</MsgId>\n"+
- "</xml>";
- if(type == 'other') {
- xml = $('#sendxml').val();
- }
- $('#sendxml').val(xml);
- }
- function submitform() {
- buildRequest(curtype);
- var id = $('#account').val();
- $.ajax('<?php echo $_W['siteroot']?>api.php?flag=1&id=' + id, {
- type : 'POST',
- headers : {"Content-type" : "text/xml"},
- data : $('#sendxml').val().replace(/[\r\n]/g,""),
- success : function(data) {
- var data = $.parseJSON(data);
- var url = '<?php echo $_W['siteroot']?>api.php?encrypt_type=' + data.encrypt_type + '&id=' + id + '×tamp=' + data.timestamp + '&nonce=' + data.nonce + '&signature=' + data.signature + '&msg_signature=' + data.msg_signature;
- if(data.encrypt_type == 'aes') {
- var xml = "";
- xml += "<xml>\n";
- xml += "<ToUserName><![CDATA["+$('#touser').val()+"]]></ToUserName>\n";
- xml += "<Encrypt><![CDATA["+data.msg+"]]></Encrypt>\n";
- xml += "</xml>";
- } else {
- var xml = $('#sendxml').val();
- }
- $('#svtext').hide();$('#svurlbox').hide();$('#svinfolist').hide();
- $('div.mediaFooterbox', $('#demoSendBox')).show();
- $.ajax(url, {
- type : 'POST',
- headers : {"Content-type" : "text/xml"},
- data : xml.replace(/[\r\n]/g,""),
- beforeSend : function(){
- if(curtype!='subscribe' && curtype!='unsubscribe'){
- if(curtype=='text' || curtype=='image' || curtype == 'location'){
- $('#svposttext').show();
- }
- }
- $('#receive').text('加载中。。。');
- }
- }).done(function(s){
- if(1 || curtype!='unsubscribe'){
- $.ajax('<?php echo $_W['siteroot']?>api.php?flag=2&id=' + id, {
- type : 'POST',
- headers : {"Content-type" : "text/xml"},
- data : s.replace(/[\r\n]/g,""),
- success : function(s) {
- var xmlobject = getxml(s);
- if(xmlobject){
- var xmlobj = xmlobject.getElementsByTagName("xml");
- if(xmlobj.length){
- var xmls = xmlobj.item(0);
- var xml = xmls;
- /* var FromUserName = xml.getElementsByTagName("FromUserName")[0].firstChild.nodeValue;
- var ToUserName = xml.getElementsByTagName("ToUserName")[0].firstChild.nodeValue;
- var MsgType = xml.getElementsByTagName("MsgType")[0].firstChild.nodeValue; */
- if (xml.getElementsByTagName("FromUserName").length > 0) {
- var FromUserName = xml.getElementsByTagName("FromUserName")[0].firstChild.nodeValue;
- var ToUserName = xml.getElementsByTagName("ToUserName")[0].firstChild.nodeValue;
- var MsgType = xml.getElementsByTagName("MsgType")[0].firstChild.nodeValue;
- } else {
- var MsgType = 'text';
- var Content = '';
- }
- if(MsgType=='text'){
- if (xml.getElementsByTagName("FromUserName").length > 0) {
- var Content = xml.getElementsByTagName("Content")[0].firstChild.nodeValue;
- } else {
- var Content = '';
- }
- Content = nl2br(Content);
- Content = Content.replace('./index', "../app/index");
- Content && $('#svtext').show().find('div.btn').html(Content);
- }else if(MsgType == 'news'){
- var Title = xml.getElementsByTagName("Title")[0].firstChild.nodeValue;
- var Description = xml.getElementsByTagName("Description")[0].firstChild.nodeValue;
- var PicUrl = xml.getElementsByTagName("PicUrl")[0].firstChild.nodeValue;
- var Url = xml.getElementsByTagName("Url")[0].firstChild.nodeValue;
- if(Url.indexOf('http://') == -1 && Url.indexOf('https://') == -1) {
- Url = '../app/' + Url;
- }
- $('#svtitle').html(Title);
- $('#svinfo').html(Description);
- $('#svpic').attr('src', PicUrl);
- $('#svurlbox').show().find('a#svurl').attr('href', Url);
- var titleObj = xml.getElementsByTagName("Title");
- if(titleObj.length>1){
- var svinfolist = imghtml = '';
- var UrlObj = xml.getElementsByTagName("Url");
- var PicUrlObj = xml.getElementsByTagName("PicUrl");
- for(var ti=1;ti<titleObj.length;ti++){
- imghtml = PicUrlObj[ti].firstChild.nodeValue ? '<img align="right" src="'+PicUrlObj[ti].firstChild.nodeValue+'">' : '';
- svinfolist += '<p class="clearfix" onclick="popensvurl(\''+UrlObj[ti].firstChild.nodeValue+'\')">'+titleObj[ti].firstChild.nodeValue+imghtml+'</p>';
- }
- $('div.mediaFooterbox', $('#demoSendBox')).hide();
- $('#svinfolist').show().html(svinfolist);
- }
- }
- }
- }
- $('#receive').text(s);
- }
- });
- }else{
- $('#receive').text('模拟取消关注成功');
- }
- })
- }
- });
- }
- function nl2br(str, is_xhtml) {
- var breakTag = (is_xhtml || typeof is_xhtml === 'undefined') ? '<br ' + '/>' : '<br>'; // Adjust comment to avoid issue on phpjs.org display
- return (str + '').replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1' + breakTag + '$2');
- }
- </script>
- <?php }
- ?>
- <?php template('common/footer'); ?>
|