123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244 |
- function callar(){
-
- ajax.get('/artrack/count_ar', {
- event_id: 'share_page_play_click',
- ar_key: '10001240',
- ar_type: '0'
- });
- var data = {};
- var arValue = {
- arKey: '10001240',
- arType: '0',
- arLoc: '',
- arChannel: 'share'
- };
- if (Box.isBox) {
- // 在框内
- var isIos = false;
- var isAndroid = false;
- isIos = !(isAndroid = Box.os.name === 'android');
- if (isAndroid) {
- Box.android.invokeApp('Bdbox_android_send_intent', 'send', [
- 'intent:widgetid://com.baidu.searchbox/-1#Intent;' + 'action=com.baidu.searchbox.action.ar_invoke;' + 'category=android.intent.category.LAUNCHER;' + 'component=com.baidu.searchbox/.CodeScannerActivity;' + 'launchFlags=0x10000000;' + 'S.arValue=' + JSON.stringify(arValue) + ';' + 'end'
- ]);
- } else {
- location.href = 'baiduboxapp://imagesearch?action=ar_invoke&arValue=' + JSON.stringify(arValue);
- }
- } else {
- var intent = 'intent:widgetid://com.baidu.searchbox/-1#Intent;' + 'action=com.baidu.searchbox.action.ar_invoke;' + 'category=android.intent.category.LAUNCHER;' + 'component=com.baidu.searchbox/.CodeScannerActivity;' + 'launchFlags=0x10000000;' + 'S.arValue=' + JSON.stringify(arValue) + ';' + 'end';
- data.iosScheme = 'baiduboxapp://imagesearch?action=ar_invoke&arValue=' + JSON.stringify(arValue);
- data.androidCommand = 'baiduboxapp://utils?action=sendIntent&minver=6.9.1¶ms=' + encodeURIComponent(JSON.stringify({
- intent: intent
- }));
- openBox.open(data);
- }
- }
- !function(){ window.__data = {
- src: '',
- arkey: '10001240',
- artype: '0'
- };
- window.__statis.push(window.__data);
- // require('site:widget/play-without-image/play.js');
- }();
- !function(){window.Du = {
- front: {
- pcPageUrl: 'http://www.baidu.com'
- }
- };
- window.openBox = window.OpenBox({
- // showTip: true,
- serverSchemeInfo: {
- type: 'feed',
- context: '%7B"nid"%3A"news_3740858182797623185"%2C"content_sign"%3A"7406472419345964060"%2C"sourceFrom"%3A"bjh"%7D'
- },
- from: 'openBoxTest',
- channel: 'openBoxTextChannel'
- });
- }();
- function get_path() {
- var url = document.location.href.toString();
- var index = url.lastIndexOf("/");
- var relUrl = url.substring(0, index);
- if (relUrl.indexOf("?") != -1) {
- relUrl = relUrl.split("?")[0];
- }
- return relUrl;
- }
- var share_title = '梁家河 · 一个把心留住的地方';
- var share_summary = '梁家河数字博物馆,用互联网科技带你身临其境,穿越知青岁月。';
- var share_url = "https://baike.baidu.com/activity/liangjiahe";
- var share_icon = get_path()+"/img/icon.jpg";
- var BoxShareData = {
- "successcallback": "",// 回调函数名,基本没用
- "errorcallback": "",// 回调函数名,基本没用
- "options": {
- "type": "url", // 链接分享
- "mediaType": "all", // 所有平台(调起分享面板)
- "linkUrl": share_url, // 需要分享的链接
- "title": share_title, // 分享的标题
- "content": share_summary, // 可根据需要与title不同,此处仅为示例
- "iconUrl": share_icon, // 链接分享中的缩略图
- }
- };
-
- var shareData = {
- title: "梁家河 · 一个把心留住的地方",
- desc: "梁家河数字博物馆,用互联网科技带你身临其境,穿越知青岁月。",
- link: "https://baike.baidu.com/activity/liangjiahe",
- imgUrl: get_path()+"/img/icon.jpg"
- };
- var shareDataTl = {
- title: "梁家河·一个把心留住的地方",
- desc: "梁家河数字博物馆,用互联网科技带你身临其境,穿越知青岁月。",
- link: "https://baike.baidu.com/activity/liangjiahe",
- imgUrl: get_path()+"/img/icon.jpg"
- };
-
- function weixin_callback(data) {
- wx.config({
- appId: data.appId,
- timestamp: data.timestamp,
- nonceStr: data.nonceStr,
- signature: data.signature,
- jsApiList: ['onMenuShareTimeline', 'onMenuShareAppMessage', 'onMenuShareQQ', 'onMenuShareWeibo', 'onMenuShareQZone']
- });
- wx.ready(function() {
- wx.onMenuShareAppMessage(shareData);
- wx.onMenuShareTimeline(shareDataTl);
- wx.onMenuShareQQ(shareData);
- wx.onMenuShareWeibo(shareData);
- wx.onMenuShareQZone(shareData);
- });
- }
-
-
- //点赞
-
- var doapi = function(data,api){
- data.authkey = '1d96cb6c6977c801723bc2703703d18c';
- //console.log(data);
- var res = null;
- $.ajax({
- url:"http://api.360shijue.com/baike/index.php/api/"+api,
- data:data,
- async:false,
- type:"POST",
- dataType:"json",
- success:function(res){
- res = res;
- if(api == like){
-
- }else if(api == unlike){
-
- }else{
- if(res.liked == 0){
- krpano.call("unlike");
- }else if(res.liked == 1){
- krpano.call("like");
- }
- }
- console.log(res);
- },
- error:function(res){
- res = res;
- console.log(res);
- }
- });
- return res;
- }
- function like(){
- var data = {};
- data.u_id = AMOUNT.num;
- doapi(data,'like');
- initlike();
- }
- function unlike(){
- var data = {};
- data.u_id = AMOUNT.num;
- doapi(data,'unlike');
- initlike();
- }
- function initlike(){
- var data = {};
- data.u_id = AMOUNT.num;
- doapi(data,'getlikestatus');
-
- }
- function initnum(){
- krpano.set("layer[zhannum].html",AMOUNT.like);
- krpano.set("layer[zhanleft].html",AMOUNT.num);
- initlike();
- }
-
- function rqstunm(url){
- $.ajax({
- url:url,
-
- async:false,
- type:"POST",
- dataType:"json",
- success:function(res){
- console.log(res);
- },
- error:function(res){
- console.log(res);
- }
- });
- }
-
- function krqstunm(id){
- if(id == 1 ){
- rqstunm("https://baike.baidu.com/activity/liangjiahe/trace?callback=tracezh&type=zh");
- }else{
- rqstunm("https://baike.baidu.com/activity/liangjiahe/trace?callback=traceen&type=en");
- }
- }
- function asign(){
- var data = {};
- doapi(data,'asign');
- }
- function bsign(){
- var data = {};
- doapi(data,'bsign');
- }
-
|