var xici_user_api = "http://www.xici.net/apps/wedding/?method=wedding.user.getusername&from=comm_nav&jsoncallback=?"; var goldenflower_drop_api = "http://jinhua.xici.net/api/drop?userid={0}&username={1}&userlevel={2}&usercity={3}&activityid={4}&jsoncallback=?"; var goldenflower_accept_url = "http://jinhua.xici.net/gf/{0}/gift?aprid={1}"; var accepturl; $.format = function (source, params) { if (arguments.length == 1) return function () { var args = $.makeArray(arguments); args.unshift(source); return $.format.apply(this, args); }; if (arguments.length > 2 && params.constructor != Array) { params = $.makeArray(arguments).slice(1); } if (params.constructor != Array) { params = [params]; } $.each(params, function (i, n) { source = source.replace(new RegExp("\\{" + i + "\\}", "g"), n); }); return source; }; function log(msg) { console.log(msg); } function getQueryString(name) { var jssrc = $(‘#goldenflower‘).attr(‘src‘); var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); var r = jssrc.substring(jssrc.indexOf("?")).substr(1).match(reg); if (r != null) return unescape(r[2]); return null; } $.ajax({ url: xici_user_api, type: ‘GET‘, scriptCharset: ‘GB2312‘, cache: false, async: true, dataType: ‘json‘, error: function () { }, success: function (xiciDate) { if (xiciDate.Result.UserId > 0) { var activityid = getQueryString("activityid"); var dropUrl = $.format(goldenflower_drop_api, xiciDate.Result.UserId, xiciDate.Result.UserName, xiciDate.Result.UserLevel, xiciDate.Result.UserCity, activityid); dropUrl = encodeURI(dropUrl); $.ajax({ url: dropUrl, type: ‘GET‘, scriptCharset: ‘UTF-8‘, cache: false, async: true, dataType: ‘json‘, error: function () { }, success: function (dropData) { if (dropData.status) { var body = $("body"); accepturl = $.format(goldenflower_accept_url, activityid, dropData.aprid); var bottomHtml = $.format(dropHtml, dropData.flashurl, dropData.flashurl); body.append(bottomHtml); } } }); } } }); function Flash_ClickOpen() { document.getElementById(‘bottomToolbar‘).innerHTML = ""; document.getElementById(‘bottomToolbar‘).style.display = ‘none‘; window.open(accepturl); } function Flash_ClickClose() { document.getElementById(‘bottomToolbar‘).innerHTML = ""; document.getElementById(‘bottomToolbar‘).style.display = ‘none‘; } var dropHtml = ‘<div id="bottomToolbar"><object width="970" height="350"‘ + ‘codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0"‘ + ‘classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">‘ + ‘<param value="{0}" name="movie">‘ + ‘<param value="high" name="quality">‘ + ‘<param value="transparent" name="wmode">‘ + ‘<param value="exactfit" name="SCALE">‘ + ‘<embed width="970" height="350" wmode="transparent" type="application/x-shockwave-flash"‘ + ‘pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"‘ + ‘quality="high" src="{1}">‘ + ‘</object></div>‘; http://jinhua.xici.net/api/drop?userid=15346193&username=wolfzz&userlevel=1&usercity=nanjing&activityid=1&jsoncallback=?
?({"status":true,"message":"success","aprid":338075,"flashurl":"http://www.xici.net/flash/suguo.swf","title":"苏果超市50元购物卡","shopname":"苏果超市","point":10})
http://jinhua.xici.net/gf/{0}/gift?aprid={1}
时间: 2024-11-07 09:30:00